#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	vector<int>votes;
	for(int i=0;i<m;i++){
		cin>>votes[i];
	}
	sort(votes.begin(),votes.end());
	for(int j=0;j<votes.size();j++){
		cout<<votes[j]<<" ";
	}
	cout<<endl;
	return 0;
}
